package com.ykg.exception;

import com.ykg.enums.ResultEnum;
import lombok.Getter;

/**
 * TODO
 * 类(接口)：
 * Created on 8:11 2021/6/23.
 *
 * @Author: laobian
 * @Description:
 */
@Getter
public class CommonException extends RuntimeException {
    private final Integer code;

    public CommonException(ResultEnum resultEnum) {
        super(resultEnum.getMsg());
        this.code = resultEnum.getCode();
    }

    public CommonException(Integer code, String message) {
        super(message);
        this.code = code;
    }

}
